package org.softee.functional;

import java.util.Collection;

public class Functionals {
    /**
     * Intentionally non-instantiable
     */
    private Functionals() {

    }

    /**
     * TODO decide whether to use forEach(data) or with(data) semantics. forEach() is misleading,
     * as transpose() and reduce() operate on data as a collection, not as individual elements
     * @param data
     * @return a Functional implementation operating on data
     */
    public static <F> Functional<F> forEach(Collection<F> data) {
        return with(data);
    }

    /**
     *
     * @param data
     * @return a Functional implementation operating on data
     */
    public static <F> Functional<F> with(Collection<F> data) {
        return new Sequential<F>(data);
    }
}
